package cn.faster.config.filter;

import cn.faster.config.crossdomain.CorsFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author xiaoCoder
 * @version 1.0
 * @description: springMvc 拦截器
 * @date 2021/8/11 21:34
 */
@Configuration
public class WebAppConfigurer  implements WebMvcConfigurer {

    @Autowired
    private TokenInterceptor tokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor)
                .addPathPatterns("/**")
                //.excludePathPatterns("/shiro/userStatus/login")
                //.excludePathPatterns("/shiro/userStatus/captcha.jpg")
        .excludePathPatterns("/shiro/userStatus/**")
                .excludePathPatterns("/druid/**")
        ;
    }
}
